<?php

class Soul_Template_Html_Grid_Cell_Datetime extends Soul_Template_Html_Grid_Cell_Base {

	private $_format = 'l';

	public function __construct(){
		parent::__construct();
	}

	public function getFormat(){
		return $this->_format;
	}
	public function setFormat($value){
		$this->_format = $value;
		return $this;
	}

	public function getFormatText(){
		$result = parent::getFormatText();
		if(!empty($result)){
			$result = Soul_Language_Factory::getCulture()->formatDate(strtotime($result), $this->getFormat());
		}
		return $result;
	}

	public function renderChildren() {
		return '<span>'.$this->getFormatText().'</span>';
	}
}